import request from '@/utils/request'

/**
 * 查询设备列表
 * @returns {*}
 */
export function getDeviceList() {
  return request({
    url: '/videoMonitor/device/list',
    method: 'get'
  })
}

/**
 * 查询设备通道列表
 * @returns {*}
 */
export function getChannelList(deviceId) {
  return request({
    url: '/videoMonitor/device/'+deviceId+'/channels',
    method: 'get'
  })
}

/**
 * 点播
 * @returns {*}
 */
export function start(deviceId,channelId) {
  return request({
    url: `/videoMonitor/device/start/${deviceId}/${channelId}`,
    method: 'get'
  })
}

/**
 * 回放记录
 * @returns {*}
 */
export function historyApi(deviceId,channelId,startTime,endTime) {
  return request({
    url: `/videoMonitor/device/record/query/${deviceId}/${channelId}`,
    method: 'get',
    params: {
      startTime: startTime,
      endTime: endTime
    }
  })
}

/**
 * 回放视频播放
 * @param deviceId
 * @param channelId
 * @param startTime
 * @param endTime
 * @returns {*}
 */
export function startHistory(deviceId,channelId,startTime,endTime) {
  return request({
    url: `/videoMonitor/device/record/start/${deviceId}/${channelId}`,
    method: 'get',
    params: {
      startTime: startTime,
      endTime: endTime
    }
  })
}

/**
 * 回放停止
 * @param deviceId
 * @param channelId
 * @param stream
 * @returns {*}
 */
export function stopHistory(deviceId,channelId,stream) {
  return request({
    url: `/videoMonitor/device/record/stop/${deviceId}/${channelId}/${stream}`,
    method: 'get'
  })
}
/**
 * 点播停止
 * @param deviceId
 * @param channelId
 * @returns {*}
 */
export function stopDevice(deviceId,channelId) {
  return request({
    url: `/videoMonitor/device/stop/${deviceId}/${channelId}`,
    method: 'get'
  })
}





